class Tools {
  String formatDate() {
    //padLeft(int width,String padding)：如果字符串长度小于width，在左边填充padding
    var date = DateTime.now();
    String timestamp =
        "${date.year.toString()}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')} ${date.hour.toString().padLeft(2, '0')}:${date.minute.toString().padLeft(2, '0')}";

    return timestamp;
  }

  static int getFontIcon(String key) {
    int a = 0;
    List fonts = [
      {"key": "icon_user", "value": 0xe95a},
      {"key": "icon_handover", "value": 0xe941},
      {"key": "icon_idea_7", "value": 0xe939},
      {"key": "icon_lamp", "value": 0xe900},
      {"key": "icon_idea_2", "value": 0xe93a},
      {"key": "icon_handover2", "value": 0xe901},
      {"key": "icon_ellipse", "value": 0xe902},
      {"key": "icon_rms", "value": 0xe95f},
      {"key": "icon_cash", "value": 0xe93c},
      {"key": "icon_bill", "value": 0xe944},
      {"key": "icon_data", "value": 0xe909},
      {"key": "icon_vip", "value": 0xe903},
      {"key": "icon_vip1", "value": 0xe95b},
      {"key": "icon_vip2", "value": 0xe911},
      {"key": "icon_wechatpay", "value": 0xe945},
      {"key": "},icon_alipay", "value": 0xe947},
      {"key": "icon_meituan_path1", "value": 0xe904},
      {"key": "icon_meituan_path2", "value": 0xe905},
      {"key": "icon_meituan_path3", "value": 0xe906},
      {"key": "icon_elema", "value": 0xe912},
      {"key": "icon_tackout", "value": 0xe907},
      {"key": "icon_tackout1", "value": 0xe908},
      {"key": "icon_wifi", "value": 0xe90a},
      {"key": "icon_wifi_no_network", "value": 0xe90b},
      {"key": "icon_wifi_off", "value": 0xe90c},
      {"key": "icon_change", "value": 0xe90d},
      {"key": "icon_change1", "value": 0xe90e},
      {"key": "icon_message", "value": 0xe916},
      {"key": "icon_preorder", "value": 0xe938},
      {"key": "icon_order", "value": 0xe93f},
      {"key": "icon_service", "value": 0xe90f},
      {"key": "icon_service1", "value": 0xe910},
      {"key": "icon_setting", "value": 0xe955},
      {"key": "icon_back_manage", "value": 0xe913},
      {"key": "icon_backup", "value": 0xe914},
      {"key": "icon_back_manage1", "value": 0xe918},
      {"key": "icon_data_recovery", "value": 0xe915},
      {"key": "icon_change_password", "value": 0xe917},
      {"key": "icon_change_password1", "value": 0xe919},
      {"key": "icon_data_recovery1", "value": 0xe91a},
      {"key": "icon_data_recovery2", "value": 0xe91b},
      {"key": "icon_data_backup1", "value": 0xe91c},
      {"key": "icon_data_backup3", "value": 0xe91d},
      {"key": "icon_help", "value": 0xe91e},
      {"key": "icon_help1", "value": 0xe91f},
      {"key": "icon_back_manage2", "value": 0xe93e},
      {"key": "icon_computer", "value": 0xe920},
      {"key": "icon_repair_computer", "value": 0xe921},
      {"key": "icon_add_printer", "value": 0xe922},
      {"key": "icon_printer", "value": 0xe952},
      {"key": "icon_download_data", "value": 0xe923},
      {"key": "icon_scan", "value": 0xe924},
      {"key": "icon_scan_phone", "value": 0xe925},
      {"key": "icon_scan_phone1", "value": 0xe926},
      {"key": "icon_delete", "value": 0xe927},
      {"key": "icon_ip", "value": 0xe93b},
      {"key": "icon_lamp1", "value": 0xe940},
      {"key": "icon_minimize", "value": 0xe942},
      {"key": "icon_close", "value": 0xe943},
      {"key": "icon_statistics", "value": 0xe946},
      {"key": "icon_back", "value": 0xe948},
      {"key": "icon_bale", "value": 0xe949},
      {"key": "icon_guqing", "value": 0xe94c},
      {"key": "icon_multiple_connections", "value": 0xe94d},
      {"key": "icon_keyboard", "value": 0xe94e},
      {"key": "icon_menu", "value": 0xe94f},
      {"key": "icon_modify", "value": 0xe950},
      {"key": "icon_locking", "value": 0xe951},
      {"key": "icon_search", "value": 0xe954},
      {"key": "icon_table", "value": 0xe956},
      {"key": "icon_time", "value": 0xe957},
      {"key": "icon_toleft", "value": 0xe958},
      {"key": "icon_toright", "value": 0xe959}
    ];
    for (var item in fonts) {
      if (item['key'].toString() == key) {
        a = item['value'];
      }
    }
    return a;
  }
}
